/*
* name;
*/
class TileUILogic extends ui.BakTileUI {

    /**
     * Getter $m_IsHaveShowTile
     * @return {boolean}
     */
    public get $m_IsHaveShowTile(): boolean {
        return this.m_IsHaveShowTile;
    }

    private m_IsHaveShowTile: boolean;

    /**
     * Getter $m_ShowNum
     * @return {number}
     */
    public get $m_ShowNum(): number {
        return this.m_ShowNum;
    }
    private m_ShowNum: number;
    constructor() {
        super();
        this.m_ShowTile.on(Laya.Event.CLICK, this, () => {
            if (GameManager.Instance.LevelUIInstance && GameManager.Instance.LevelUIInstance.IsDelMode()) {
                GameManager.Instance.LevelUIInstance.$m_isDelMode = false;
                this.HideShowTile();
            }
        })
    }
    public SetShowTile(tileNum: number, istmp: boolean): void {
        this.m_ShowTile.visible = true;
        this.m_ShowTile.x = 38.5;
        this.m_ShowTile.y = 43.5;
        if (istmp) {
            this.m_ShowTile.texture = Laya.loader.getRes("LevelUI/bak" + tileNum + ".png");
        }
        else {
            this.m_ShowTile.texture = Laya.loader.getRes("LevelUI/" + tileNum + ".png");
            this.m_IsHaveShowTile = true;
            this.m_ShowNum = tileNum;
        }

    }
    public HideShowTile(): void {
        this.m_ShowTile.visible = false;
        this.m_IsHaveShowTile = false;
        this.m_ShowNum = 0;
    }
    public ShowTileTweenToPos(PosX: number, PosY: number, duration: number): void {
        if (this.m_IsHaveShowTile) {
            Laya.Tween.to(this.m_ShowTile, { x: PosX, y: PosY }, duration, Laya.Ease.linearIn, Laya.Handler.create(this
                , () => { this.HideShowTile(); }));
        }
    }
}